--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/marcmere/Box Sync/Shared_EffectofIncarceration_Pennslyvania/Replication Data/PA sentencing/PASentencingData.log
  log type:  text
 opened on:  17 Dec 2016, 10:19:08

. 
. clear all 

. set more off

. 
. ***********************************************************************
. *
. * Table 4, Table A2: Different Punishments and 08 and 12 turnout and corrections (full sample) 
. *
. ***********************************************************************
. 
. use "sentencingvfreplication.dta", clear

. 
. * Full and restricted sample for key variables (main text)
. 
. gen delta_turnout=X_GEN_2012_11-X_GEN_2008_11

. label var delta_turnout "Change in turnout 2012-2008"

. 
. gen delta_corrections=match_corrections2012-match_corrections2008

. label var delta_corrections "Change in corrections record 2012-2008"

. 
. * Difference in length of sentence between full and restricted sample
. sum length_incarceration if o_anyprison == 1

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
length_inc~n |      9837    14945.23    194595.7          0    2918483

. sum length_incarceration if o_anyprison == 1 & restricted_sample == 1

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
length_inc~n |       603    1634.352    1141.472          0       7304

. 
. centile length_incarceration if o_anyprison == 1, centile(25 50 75)

                                                       -- Binom. Interp. --
    Variable |     Obs  Percentile      Centile        [95% Conf. Interval]
-------------+-------------------------------------------------------------
length_inc~n |    9837         25           730             730         911
             |                 50          1460            1460        1460
             |                 75          2191            2191        2191

. centile length_incarceration if o_anyprison == 1 & restricted_sample == 1, centile(25 50 75)

                                                       -- Binom. Interp. --
    Variable |     Obs  Percentile      Centile        [95% Conf. Interval]
-------------+-------------------------------------------------------------
length_inc~n |     603         25           730             730    973.6709
             |                 50          1460            1460        1460
             |                 75          2190            1825        2190

. 
. * Full sample
. forvalues ctr = 1(1)6 {
  2.  local templabel : label (o_MS_SANCTION) `ctr'
  3.  di "Working on outcome: `templabel'"
  4.  if `ctr'==1 {
  5.   outsum X_GEN_2012_11 X_GEN_2008_11 delta_turnout match_corrections2012 match_corrections2008 delta_corrections /*
>   */ using "Table04_PA_KeySummaryStatsbyPunishmnent_PanelB_FullSample.out" if o_anyprison == 1, replace bracket ctitle("`templabel'")
  6.   outsum X_GEN_2012_11 X_GEN_2008_11 delta_turnout match_corrections2012 match_corrections2008 delta_corrections /*
>   */ using "Table04_PA_KeySummaryStatsbyPunishmnent_PanelB_FullSample.out" if o_anyprison ~= 1, append bracket ctitle("All Other Sentences")
  7.  }
  8.  else {
  9.   outsum X_GEN_2012_11 X_GEN_2008_11 delta_turnout match_corrections2012 match_corrections2008 delta_corrections /*
>   */ using "Table04_PA_KeySummaryStatsbyPunishmnent_PanelB_FullSample.out" if o_MS_SANCTION==`ctr' & o_anyprison ~= 1, append bracket ctitle("`templabel'")
 10.  }
 11. }
Working on outcome: State Prison
Working on outcome: State Intermediate Punishment
Working on outcome: County Jail
Working on outcome: Restrictive Intermediate Punishment
Working on outcome: Probation
Working on outcome: Other Restorative Sanction

. 
. * Restricted sample
. forvalues ctr = 1(1)6 {
  2.  local templabel : label (o_MS_SANCTION) `ctr'
  3.  di "Working on outcome: `templabel'"
  4.  if `ctr'==1 {
  5.   outsum X_GEN_2012_11 X_GEN_2008_11 delta_turnout match_corrections2012 match_corrections2008 delta_corrections /*
>   */ using "Table04_PA_KeySummaryStatsbyPunishmnent_PanelA_RestrictedSample.out" if o_anyprison == 1 & restricted_sample == 1, replace bracket ctitle("`templabel'")
  6.   outsum X_GEN_2012_11 X_GEN_2008_11 delta_turnout match_corrections2012 match_corrections2008 delta_corrections /*
>   */ using "Table04_PA_KeySummaryStatsbyPunishmnent_PanelA_RestrictedSample.out" if o_anyprison ~= 1 & restricted_sample == 1, append bracket ctitle("All Other Sentences")
  7.  }
  8.  else {
  9.   outsum X_GEN_2012_11 X_GEN_2008_11 delta_turnout match_corrections2012 match_corrections2008 delta_corrections /*
>   */ using "Table04_PA_KeySummaryStatsbyPunishmnent_PanelA_RestrictedSample.out" if o_MS_SANCTION==`ctr' & o_anyprison ~= 1 & restricted_sample == 1, append bracket ctitle("`templabel'")
 10.  }
 11. }
Working on outcome: State Prison
Working on outcome: State Intermediate Punishment
Working on outcome: County Jail
Working on outcome: Restrictive Intermediate Punishment
Working on outcome: Probation
Working on outcome: Other Restorative Sanction

. drop delta_turnout delta_corrections

. 
. 
. * Full sample for all variables (appendix)
. forvalues ctr = 1(1)6 {
  2.  local templabel : label (o_MS_SANCTION) `ctr'
  3.  di "Working on outcome: `templabel'"
  4.  if `ctr'==1 {
  5.   outsum X_GEN_2012_11-match_correctionsany age2012 ismale-tot_sent_records /*
>   */ using "SA_Table02_PA_SummaryStatsbyPunishmnent_PanelB_FullSample.out" if o_anyprison == 1, replace bracket ctitle("`templabel'")
  6.   outsum X_GEN_2012_11-match_correctionsany age2012 ismale-tot_sent_records /*
>   */ using "SA_Table02_PA_SummaryStatsbyPunishmnent_PanelB_FullSample.out" if o_anyprison ~= 1, append bracket ctitle("All Other Sentences")
  7.  }
  8.  else {
  9.   outsum X_GEN_2012_11-match_correctionsany age2012 ismale-tot_sent_records /*
>   */ using "SA_Table02_PA_SummaryStatsbyPunishmnent_PanelB_FullSample.out" if o_MS_SANCTION==`ctr' & o_anyprison ~= 1, append bracket ctitle("`templabel'")
 10.  }
 11. }
Working on outcome: State Prison
Working on outcome: State Intermediate Punishment
Working on outcome: County Jail
Working on outcome: Restrictive Intermediate Punishment
Working on outcome: Probation
Working on outcome: Other Restorative Sanction

. 
. * Restricted sample for all variables (appendix)
. forvalues ctr = 1(1)6 {
  2.  local templabel : label (o_MS_SANCTION) `ctr'
  3.  di "Working on outcome: `templabel'"
  4.  if `ctr'==1 {
  5.   outsum X_GEN_2012_11-match_correctionsany age2012 ismale-tot_sent_records /*
>   */ using "SA_Table02_PA_SummaryStatsbyPunishmnent_PanelA_RestrictedSample.out" if o_anyprison == 1 & restricted_sample == 1, replace bracket ctitle("`templabel'")
  6.   outsum X_GEN_2012_11-match_correctionsany age2012 ismale-tot_sent_records /*
>   */ using "SA_Table02_PA_SummaryStatsbyPunishmnent_PanelA_RestrictedSample.out" if o_anyprison ~= 1 & restricted_sample == 1, append bracket ctitle("All Other Sentences")
  7.  }
  8.  else {
  9.   outsum X_GEN_2012_11-match_correctionsany age2012 ismale-tot_sent_records /*
>   */ using "SA_Table02_PA_SummaryStatsbyPunishmnent_PanelA_RestrictedSample.out" if o_MS_SANCTION==`ctr' & o_anyprison ~= 1 & restricted_sample == 1, append bracket ctitle("`templabel'")
 10.  }
 11. }
Working on outcome: State Prison
Working on outcome: State Intermediate Punishment
Working on outcome: County Jail
Working on outcome: Restrictive Intermediate Punishment
Working on outcome: Probation
Working on outcome: Other Restorative Sanction

. 
. 
. ***********************************************************************
. *
. * Table 5, Prison sentence and 12 turnout (restricted sample) 
. *
. * Note that column (1) is again out of order here; In the paper it appears in column 6
. *
. ***********************************************************************
. 
. use "sentencingvfreplication.dta", clear

. drop X_registered2012 match_corrections2008-match_corrections2012 match_correctionsany /*
> */ o_MS_SANCTION o_multiplecounts o_priorreord tot_sent_records Incarcerated2012 age2012_2 r_countynum

. 
. keep if restricted_sample == 1
(68137 observations deleted)

. drop restricted_sample 

. 
. * Runs matched pair first (for labeling reasons)
. preserve

. keep if o_anyprison==0
(603 observations deleted)

. save "temp_noprisonformerge.dta", replace
(note: file temp_noprisonformerge.dta not found)
file temp_noprisonformerge.dta saved

. restore

. keep if o_anyprison==1
(33628 observations deleted)

. rename age2012 age2012_toprison

. rename o_guidelinemin  o_guidelinemin_toprison

. rename unique_person_id_sent upis

. rename X_GEN_2012_11 X_GEN_2012_11_toprison

. count
  603

. joinby X_registered2008 X_GEN_2008_11 ismale rd_1 rd_2 rd_3 o_ogs o_anyfelony  using "temp_noprisonformerge.dta", unmatched(master)

. !erase "temp_noprisonformerge.dta"

/bin/bash: erase: command not found

. tab _merge

                       _merge |      Freq.     Percent        Cum.
------------------------------+-----------------------------------
          only in master data |         27        0.02        0.02
both in master and using data |    155,454       99.98      100.00
------------------------------+-----------------------------------
                        Total |    155,481      100.00

. drop if _merge~=3
(27 observations deleted)

. 
. * Now score the age matches
. gen agediff=abs(age2012-age2012_toprison)

. * require age to be withing 2.5 years on either side (5 year window)
. drop if agediff >2.5
(131765 observations deleted)

. 
. *summarize differences in guideline sentences
. gen sentdiff=abs(o_guidelinemin_toprison-o_guidelinemin)

. * require sentence to be within .25 (3 months)
. drop if sentdiff>.25
(6340 observations deleted)

. 
. * Keeps closest in age
. * If that is tied, keeps closest in sentence length
. * If that is tied, keeps lowest ID number as tiebreaker
. gsort upis agediff sentdiff unique_person_id_sent 

. count if upis == upis[_n-1] & agediff == agediff[_n-1] & sentdiff == sentdiff[_n-1]
  863

. count if upis == upis[_n-1] & agediff == agediff[_n-1] & sentdiff == sentdiff[_n-1] & /*
> */ unique_person_id_sent == unique_person_id_sent[_n-1]  
    0

. drop if upis==upis[_n-1]
(16968 observations deleted)

. count
  381

. 
. keep upis unique_person_id_sent X_GEN_2012_11 X_GEN_2012_11_toprison age2012 age2012_toprison o_guidelinemin o_guidelinemin_toprison X_GEN_2008_11

. 
. rename X_GEN_2012_11 X_GEN_2012_11_1

. rename X_GEN_2012_11_toprison X_GEN_2012_11_2

. rename age2012 age2012_1

. rename age2012_toprison age2012_2

. rename o_guidelinemin o_guidelinemin_1

. rename o_guidelinemin_toprison o_guidelinemin_2

. gen unique_person_id_sent_1 = upis

. rename unique_person_id_sent unique_person_id_sent_2

. 
. reshape long X_GEN_2012_11_ age2012_ o_guidelinemin_ unique_person_id_sent_, i(upis X_GEN_2008_11) j(treat) 
(note: j = 1 2)

Data                               wide   ->   long
-----------------------------------------------------------------------------
Number of obs.                      381   ->     762
Number of variables                  10   ->       7
j variable (2 values)                     ->   treat
xij variables:
        X_GEN_2012_11_1 X_GEN_2012_11_2   ->   X_GEN_2012_11_
                    age2012_1 age2012_2   ->   age2012_
      o_guidelinemin_1 o_guidelinemin_2   ->   o_guidelinemin_
unique_person_id_sent_1 unique_person_id_sent_2->unique_person_id_sent_
-----------------------------------------------------------------------------

. replace treat=treat-1
(762 real changes made)

. 
. rename X_GEN_2012_11_ X_GEN_2012_11

. rename treat o_anyprison

. rename age2012_ age2012

. rename o_guidelinemin_ o_guidelinemin

. rename unique_person_id_sent_ unique_person_id_sent

. 
. areg X_GEN_2012_11 o_anyprison age2012 o_guidelinemin, absorb(upis) cluster(unique_person_id_sent)

Linear regression, absorbing indicators           Number of obs   =        762
                                                  F(   3,    725) =       1.36
                                                  Prob > F        =     0.2535
                                                  R-squared       =     0.5727
                                                  Adj R-squared   =     0.1398
                                                  Root MSE        =     0.3357

                  (Std. Err. adjusted for 726 clusters in unique_person_id_sent)
--------------------------------------------------------------------------------
               |               Robust
 X_GEN_2012_11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
   o_anyprison |   .0010426   .0248668     0.04   0.967    -.0477769    .0498622
       age2012 |   .0456591   .0390936     1.17   0.243     -.031091    .1224093
o_guidelinemin |   .9326896   .5423382     1.72   0.086    -.1320512     1.99743
         _cons |  -1.990528   1.406588    -1.42   0.157    -4.752001    .7709446
---------------+----------------------------------------------------------------
          upis |   absorbed                                     (381 categories)

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyprison if e(sample)

. local inprison=r(N)*r(mean)

. outreg2 using "Table05_PA_EffectofPrisononParticipation_RestrictedSample.out", replace se bracket label /*
> */ dec(3) symbol(***, **, *) ctitle("Matched Pairs") /*
> */ addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated to Prison",`inprison')  
dir : seeout

. 
. use "sentencingvfreplication.dta", clear

. drop X_registered2012 match_corrections2008-match_corrections2012 match_correctionsany /*
> */ o_MS_SANCTION o_multiplecounts o_priorreord tot_sent_records

. 
. keep if restricted_sample == 1
(68137 observations deleted)

. drop restricted_sample 

. 
. * County Fixed Effects
. quietly tab r_countynum, gen(cd_)

. * Drop Allegheny county
. drop cd_2 r_countynum

. 
. * OGS Fixed Effects
. quietly tab o_ogs, gen(ogs_)

. * Drop offense gravity score 1
. drop ogs_1 o_ogs

. 
. * Bivariate regression, assigned to prison
. regress X_GEN_2012_11 o_anyprison, robust

Linear regression                                      Number of obs =   34231
                                                       F(  1, 34229) =    0.00
                                                       Prob > F      =  0.9799
                                                       R-squared     =  0.0000
                                                       Root MSE      =  .36553

------------------------------------------------------------------------------
             |               Robust
X_GEN_201~11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 o_anyprison |    .000378   .0150324     0.03   0.980     -.029086     .029842
       _cons |    .158826   .0019933    79.68   0.000     .1549191    .1627329
------------------------------------------------------------------------------

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyprison if e(sample)

. local inprison=r(N)*r(mean)

. outreg2 using "Table05_PA_EffectofPrisononParticipation_RestrictedSample.out", append se bracket label /*
> */ dec(3) symbol(***, **, *) ctitle("Bivariate Regression") /*
> */ addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated to Prison",`inprison')  
warning: addnote ignored in appended columns
dir : seeout

. 
. * past participation
. regress X_GEN_2012_11 o_anyprison X_registered2008 X_GEN_2008_11 , robust

Linear regression                                      Number of obs =   34231
                                                       F(  3, 34227) = 1791.33
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.2199
                                                       Root MSE      =  .32286

----------------------------------------------------------------------------------
                 |               Robust
   X_GEN_2012_11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
     o_anyprison |  -.0075162   .0135278    -0.56   0.578    -.0340311    .0189988
X_registered2008 |   .0709481   .0036536    19.42   0.000     .0637869    .0781093
   X_GEN_2008_11 |   .3621175    .006648    54.47   0.000     .3490872    .3751477
           _cons |   .0447237    .001584    28.24   0.000     .0416191    .0478284
----------------------------------------------------------------------------------

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyprison if e(sample)

. local inprison=r(N)*r(mean)

. outreg2 using "Table05_PA_EffectofPrisononParticipation_RestrictedSample.out", append se bracket label /*
> */ dec(3) symbol(***, **, *) ctitle("Past Participation") /*
> */ addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated to Prison",`inprison')  
warning: addnote ignored in appended columns
dir : seeout

. 
. * demographics
. regress X_GEN_2012_11 o_anyprison age2012 age2012_2 ismale rd_2 rd_3 rd_1 cd_* , robust

Linear regression                                      Number of obs =   34231
                                                       F( 73, 34157) =    1.12
                                                       Prob > F      =  0.2287
                                                       R-squared     =  0.0022
                                                       Root MSE      =  .36551

------------------------------------------------------------------------------
             |               Robust
X_GEN_201~11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
 o_anyprison |   .0032563    .015131     0.22   0.830     -.026401    .0329136
     age2012 |   .0000323   .0010879     0.03   0.976       -.0021    .0021647
   age2012_2 |   .0000524   .0013018     0.04   0.968    -.0024991     .002604
      ismale |  -.0028787   .0045177    -0.64   0.524    -.0117335    .0059761
        rd_2 |  -.0031137   .0057593    -0.54   0.589    -.0144022    .0081748
        rd_3 |    .001084   .0151093     0.07   0.943    -.0285308    .0306988
        rd_1 |   .0018637   .0080095     0.23   0.816    -.0138351    .0175626
        cd_1 |   .0292426   .0207087     1.41   0.158    -.0113472    .0698324
        cd_3 |   .0012201   .0292627     0.04   0.967    -.0561358     .058576
        cd_4 |   .0181909   .0185103     0.98   0.326    -.0180899    .0544716
        cd_5 |   .0146743   .0298433     0.49   0.623    -.0438196    .0731683
        cd_6 |   .0041329    .014155     0.29   0.770    -.0236114    .0318773
        cd_7 |  -.0193807   .0181271    -1.07   0.285    -.0549105    .0161491
        cd_8 |   .0490255    .028693     1.71   0.088    -.0072138    .1052648
        cd_9 |   .0060004    .009487     0.63   0.527    -.0125944    .0245953
       cd_10 |   .0093565   .0181129     0.52   0.605    -.0261453    .0448584
       cd_11 |    .041042    .023572     1.74   0.082    -.0051598    .0872439
       cd_12 |    .063232   .1099875     0.57   0.565    -.1523472    .2788113
       cd_13 |  -.0171835    .022327    -0.77   0.442    -.0609451    .0265781
       cd_14 |  -.0055574   .0187894    -0.30   0.767    -.0423852    .0312703
       cd_15 |   .0308825   .0122683     2.52   0.012     .0068363    .0549287
       cd_16 |  -.0181459   .0306127    -0.59   0.553    -.0781479     .041856
       cd_17 |  -.0053718   .0430294    -0.12   0.901    -.0897108    .0789672
       cd_18 |   .0205034   .0257912     0.79   0.427    -.0300482    .0710551
       cd_19 |   .0873719   .0438121     1.99   0.046     .0014986    .1732451
       cd_20 |   .0010758   .0218934     0.05   0.961     -.041836    .0439875
       cd_21 |   .0227573   .0157155     1.45   0.148    -.0080457    .0535603
       cd_22 |   .0378497   .0155143     2.44   0.015     .0074412    .0682582
       cd_23 |   .0017864   .0100035     0.18   0.858    -.0178208    .0213936
       cd_24 |   .0460872   .0399225     1.15   0.248    -.0321621    .1243366
       cd_25 |   .0055891   .0150283     0.37   0.710    -.0238668     .035045
       cd_26 |  -.0178454   .0211166    -0.85   0.398    -.0592346    .0235439
       cd_27 |   .0318186   .1166914     0.27   0.785    -.1969005    .2605376
       cd_28 |   .0011944   .0168168     0.07   0.943    -.0317671    .0341559
       cd_29 |  -.0363591   .0440848    -0.82   0.410    -.1227668    .0500486
       cd_30 |  -.0190136   .0333728    -0.57   0.569    -.0844254    .0463981
       cd_31 |   .0408688   .0325942     1.25   0.210     -.023017    .1047545
       cd_32 |   .0172623   .0256663     0.67   0.501    -.0330445    .0675692
       cd_33 |   .0138282   .0342498     0.40   0.686    -.0533026     .080959
       cd_34 |   .0253661   .0448022     0.57   0.571    -.0624477    .1131798
       cd_35 |  -.0452796   .0146392    -3.09   0.002    -.0739729   -.0165862
       cd_36 |   .0201421   .0138123     1.46   0.145    -.0069304    .0472147
       cd_37 |   .0085428   .0254988     0.34   0.738    -.0414356    .0585212
       cd_38 |   .0326027   .0204307     1.60   0.111    -.0074421    .0726475
       cd_39 |   .0120973   .0135712     0.89   0.373    -.0145028    .0386974
       cd_40 |   .0112756   .0132895     0.85   0.396    -.0147722    .0373234
       cd_41 |   .0163062   .0162504     1.00   0.316    -.0155451    .0481575
       cd_42 |   .0120681   .0256997     0.47   0.639    -.0383042    .0624405
       cd_43 |    .002561   .0189874     0.13   0.893    -.0346549    .0397769
       cd_44 |   .0308882   .0219334     1.41   0.159    -.0121021    .0738785
       cd_45 |   .0129681   .0177336     0.73   0.465    -.0217905    .0477266
       cd_46 |  -.0069892   .0098699    -0.71   0.479    -.0263345     .012356
       cd_47 |  -.0097219   .0465764    -0.21   0.835    -.1010132    .0815693
       cd_48 |   .0109964   .0132551     0.83   0.407     -.014984    .0369768
       cd_49 |   .0376507   .0219607     1.71   0.086     -.005393    .0806943
       cd_50 |   .0464725   .0274255     1.69   0.090    -.0072823    .1002273
       cd_51 |    .008406   .0131121     0.64   0.521    -.0172942    .0341062
       cd_52 |   .0134882    .031309     0.43   0.667    -.0478784    .0748548
       cd_53 |  -.0209258   .0606958    -0.34   0.730    -.1398916    .0980399
       cd_54 |   .0205626   .0239073     0.86   0.390    -.0262965    .0674218
       cd_55 |   .0064585   .0346055     0.19   0.852    -.0613695    .0742865
       cd_56 |  -.0097049   .0343129    -0.28   0.777    -.0769594    .0575496
       cd_57 |  -.0966181   .0517314    -1.87   0.062    -.1980134    .0047772
       cd_58 |  -.0317889    .026424    -1.20   0.229    -.0835809    .0200031
       cd_59 |  -.0327289   .0339438    -0.96   0.335    -.0992598     .033802
       cd_60 |  -.0319849     .03566    -0.90   0.370    -.1018798    .0379099
       cd_61 |   -.011261   .0266772    -0.42   0.673    -.0635492    .0410271
       cd_62 |    .016264   .0332335     0.49   0.625    -.0488747    .0814028
       cd_63 |   .0288658   .0193535     1.49   0.136    -.0090677    .0667992
       cd_64 |   .0044662   .0304393     0.15   0.883    -.0551959    .0641283
       cd_65 |   .0253396   .0151277     1.68   0.094    -.0043112    .0549904
       cd_66 |  -.0266976   .0372502    -0.72   0.474    -.0997093    .0463142
       cd_67 |     .01477   .0116783     1.26   0.206    -.0081198    .0376599
       _cons |   .1500852   .0228406     6.57   0.000     .1053168    .1948536
------------------------------------------------------------------------------

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyprison if e(sample)

. local inprison=r(N)*r(mean)

. outreg2 using "Table05_PA_EffectofPrisononParticipation_RestrictedSample.out", append se bracket label /*
> */ dec(3) symbol(***, **, *) ctitle("Demographics") /*
> */ addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated to Prison",`inprison')  
warning: addnote ignored in appended columns
dir : seeout

. 
. * other stuff about crime
. regress X_GEN_2012_11 o_anyprison o_anyfelony o_guidelinemin ogs_*, robust

Linear regression                                      Number of obs =   34231
                                                       F( 13, 34217) =    0.98
                                                       Prob > F      =  0.4697
                                                       R-squared     =  0.0004
                                                       Root MSE      =  .36552

--------------------------------------------------------------------------------
               |               Robust
 X_GEN_2012_11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
   o_anyprison |  -.0029892    .017691    -0.17   0.866     -.037664    .0316857
   o_anyfelony |  -.0037165   .0082999    -0.45   0.654    -.0199846    .0125516
o_guidelinemin |   .0126186   .0154035     0.82   0.413    -.0175727    .0428099
         ogs_2 |  -.0034255   .0070264    -0.49   0.626    -.0171975    .0103464
         ogs_3 |   .0086675   .0054456     1.59   0.111    -.0020061     .019341
         ogs_4 |    .017552   .0141753     1.24   0.216     -.010232     .045336
         ogs_5 |  -.0072316   .0067035    -1.08   0.281    -.0203706    .0059075
         ogs_6 |   .0025743   .0163603     0.16   0.875    -.0294925     .034641
         ogs_7 |  -.0054576   .0191298    -0.29   0.775    -.0429528    .0320375
         ogs_8 |   .0256213   .0275841     0.93   0.353    -.0284445    .0796871
         ogs_9 |   .0253399   .0357388     0.71   0.478    -.0447093    .0953891
        ogs_10 |  -.0149651   .0454217    -0.33   0.742    -.1039932     .074063
        ogs_11 |  -.0819993   .0643963    -1.27   0.203    -.2082182    .0442196
         _cons |   .1574673    .003034    51.90   0.000     .1515206     .163414
--------------------------------------------------------------------------------

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyprison if e(sample)

. local inprison=r(N)*r(mean)

. outreg2 using "Table05_PA_EffectofPrisononParticipation_RestrictedSample.out", append se bracket label /*
> */ dec(3) symbol(***, **, *) ctitle("Crime Characterestics") /*
> */ addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated to Prison",`inprison')  
warning: addnote ignored in appended columns
dir : seeout

. 
. * combined
. regress X_GEN_2012_11 o_anyprison X_registered2008 X_GEN_2008_11 age2012 age2012_2 ismale rd_2 rd_3 rd_1 cd_* o_anyfelony o_guidelinemin ogs_*, robust

Linear regression                                      Number of obs =   34231
                                                       F( 87, 34143) =   63.26
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.2220
                                                       Root MSE      =  .32283

----------------------------------------------------------------------------------
                 |               Robust
   X_GEN_2012_11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
     o_anyprison |  -.0060568   .0158671    -0.38   0.703    -.0371568    .0250432
X_registered2008 |   .0715322   .0036623    19.53   0.000     .0643539    .0787105
   X_GEN_2008_11 |   .3615536   .0066482    54.38   0.000     .3485228    .3745844
         age2012 |   .0009728   .0009725     1.00   0.317    -.0009332    .0028789
       age2012_2 |  -.0010987   .0011606    -0.95   0.344    -.0033735    .0011761
          ismale |  -.0034322   .0040824    -0.84   0.401    -.0114338    .0045695
            rd_2 |  -.0044391   .0051325    -0.86   0.387     -.014499    .0056208
            rd_3 |   .0084356   .0129146     0.65   0.514    -.0168775    .0337487
            rd_1 |  -.0004348   .0070348    -0.06   0.951    -.0142232    .0133536
            cd_1 |   .0169421   .0184609     0.92   0.359    -.0192418     .053126
            cd_3 |  -.0002521   .0250006    -0.01   0.992    -.0492542      .04875
            cd_4 |   .0110348   .0158135     0.70   0.485    -.0199602    .0420298
            cd_5 |   .0161632   .0267431     0.60   0.546    -.0362542    .0685806
            cd_6 |  -.0040643   .0127237    -0.32   0.749    -.0290033    .0208746
            cd_7 |  -.0180048   .0165955    -1.08   0.278    -.0505326    .0145231
            cd_8 |   .0308831   .0256929     1.20   0.229    -.0194759    .0812421
            cd_9 |   .0012555   .0085182     0.15   0.883    -.0154406    .0179515
           cd_10 |   .0235609   .0157416     1.50   0.134    -.0072932    .0544151
           cd_11 |    .032646   .0211022     1.55   0.122    -.0087151     .074007
           cd_12 |   .0484585   .0741099     0.65   0.513    -.0967995    .1937164
           cd_13 |  -.0083962   .0187489    -0.45   0.654    -.0451447    .0283522
           cd_14 |  -.0013211   .0168848    -0.08   0.938    -.0344159    .0317736
           cd_15 |   .0319153   .0108109     2.95   0.003     .0107256    .0531049
           cd_16 |  -.0146735   .0308723    -0.48   0.635    -.0751844    .0458373
           cd_17 |   .0119925   .0440069     0.27   0.785    -.0742626    .0982475
           cd_18 |   .0044208   .0227151     0.19   0.846    -.0401016    .0489432
           cd_19 |   .0510829   .0383456     1.33   0.183    -.0240758    .1262416
           cd_20 |  -.0095101   .0199686    -0.48   0.634    -.0486492    .0296291
           cd_21 |   .0166157   .0136934     1.21   0.225    -.0102239    .0434553
           cd_22 |   .0342688    .013549     2.53   0.011     .0077123    .0608252
           cd_23 |   .0092757   .0089944     1.03   0.302    -.0083536    .0269049
           cd_24 |   .0381351   .0355473     1.07   0.283    -.0315388    .1078089
           cd_25 |   .0094229   .0130804     0.72   0.471    -.0162151    .0350609
           cd_26 |  -.0056229   .0181342    -0.31   0.757    -.0411666    .0299208
           cd_27 |   .0122821   .0822831     0.15   0.881    -.1489954    .1735597
           cd_28 |   .0067629   .0148878     0.45   0.650    -.0224177    .0359435
           cd_29 |  -.0405534   .0340366    -1.19   0.233    -.1072662    .0261594
           cd_30 |  -.0295215   .0286426    -1.03   0.303    -.0856619    .0266189
           cd_31 |   .0494614   .0261773     1.89   0.059    -.0018469    .1007697
           cd_32 |    .014332   .0230452     0.62   0.534    -.0308374    .0595014
           cd_33 |   .0335846   .0287242     1.17   0.242    -.0227158    .0898851
           cd_34 |   .0000523   .0396747     0.00   0.999    -.0777115     .077816
           cd_35 |   -.027771   .0135658    -2.05   0.041    -.0543605   -.0011816
           cd_36 |   .0173874   .0121092     1.44   0.151     -.006347    .0411218
           cd_37 |   .0068303   .0214314     0.32   0.750    -.0351759    .0488365
           cd_38 |   .0230754   .0172661     1.34   0.181    -.0107667    .0569176
           cd_39 |    .021329   .0120306     1.77   0.076    -.0022513    .0449093
           cd_40 |   .0043767   .0119691     0.37   0.715    -.0190831    .0278365
           cd_41 |    .017919   .0145165     1.23   0.217    -.0105337    .0463718
           cd_42 |    .015254   .0236566     0.64   0.519    -.0311137    .0616217
           cd_43 |  -.0028579   .0166469    -0.17   0.864    -.0354865    .0297706
           cd_44 |   .0229304    .019139     1.20   0.231    -.0145827    .0604435
           cd_45 |   .0122897   .0151043     0.81   0.416    -.0173153    .0418948
           cd_46 |   -.005333   .0087885    -0.61   0.544    -.0225587    .0118927
           cd_47 |  -.0276088   .0483425    -0.57   0.568    -.1223616    .0671441
           cd_48 |   .0097962   .0115016     0.85   0.394    -.0127473    .0323397
           cd_49 |   .0426883   .0195706     2.18   0.029     .0043293    .0810474
           cd_50 |   .0417926    .024409     1.71   0.087    -.0060499    .0896352
           cd_51 |   .0027203    .012257     0.22   0.824    -.0213037    .0267444
           cd_52 |   .0176235   .0282216     0.62   0.532    -.0376918    .0729388
           cd_53 |   .0033803   .0618238     0.05   0.956    -.1177964    .1245571
           cd_54 |   .0075607   .0198594     0.38   0.703    -.0313645    .0464858
           cd_55 |   .0171235   .0323232     0.53   0.596     -.046231    .0804781
           cd_56 |    .006628   .0304794     0.22   0.828    -.0531127    .0663688
           cd_57 |  -.0967889   .0690525    -1.40   0.161    -.2321341    .0385562
           cd_58 |  -.0221443   .0239485    -0.92   0.355    -.0690842    .0247956
           cd_59 |  -.0143398    .031446    -0.46   0.648    -.0759749    .0472954
           cd_60 |  -.0342891     .03754    -0.91   0.361    -.1078687    .0392906
           cd_61 |  -.0073828   .0236607    -0.31   0.755    -.0537585    .0389929
           cd_62 |   .0310106   .0299256     1.04   0.300    -.0276446    .0896658
           cd_63 |   .0155746   .0163181     0.95   0.340    -.0164093    .0475585
           cd_64 |   -.008026   .0261492    -0.31   0.759    -.0592793    .0432273
           cd_65 |   .0236184   .0132912     1.78   0.076    -.0024329    .0496696
           cd_66 |  -.0147789   .0313412    -0.47   0.637    -.0762087    .0466509
           cd_67 |   .0099674   .0104334     0.96   0.339    -.0104824    .0304171
     o_anyfelony |    .001863   .0073988     0.25   0.801    -.0126388    .0163648
  o_guidelinemin |   .0029212   .0128866     0.23   0.821     -.022337    .0281795
           ogs_2 |  -.0025737   .0063242    -0.41   0.684    -.0149692    .0098219
           ogs_3 |    .004985   .0048868     1.02   0.308    -.0045933    .0145632
           ogs_4 |   .0197722   .0124288     1.59   0.112    -.0045887    .0441331
           ogs_5 |  -.0113697   .0059347    -1.92   0.055     -.023002    .0002625
           ogs_6 |   .0007561   .0149623     0.05   0.960    -.0285704    .0300826
           ogs_7 |  -.0122726   .0171131    -0.72   0.473     -.045815    .0212697
           ogs_8 |   .0237566    .023404     1.02   0.310     -.022116    .0696291
           ogs_9 |      .0351   .0302513     1.16   0.246    -.0241935    .0943936
          ogs_10 |  -.0127686   .0382407    -0.33   0.738    -.0877217    .0621845
          ogs_11 |  -.0363125   .0544316    -0.67   0.505    -.1430003    .0703752
           _cons |   .0200588   .0207165     0.97   0.333    -.0205463    .0606638
----------------------------------------------------------------------------------

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyprison if e(sample)

. local inprison=r(N)*r(mean)

. outreg2 using "Table05_PA_EffectofPrisononParticipation_RestrictedSample.out", append se bracket label /*
> */ dec(3) symbol(***, **, *) ctitle("Complete Model") /*
> */ addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated to Prison",`inprison')  
warning: addnote ignored in appended columns
dir : seeout

. 
. * Removing people who may still be incarcerated in 2012
. regress X_GEN_2012_11 o_anyprison X_registered2008 X_GEN_2008_11 age2012 age2012_2 ismale rd_2 rd_3 rd_1 cd_* o_anyfelony o_guidelinemin ogs_* if Incarcerated2012 == 0, robust

Linear regression                                      Number of obs =   33276
                                                       F( 87, 33188) =   61.28
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.2215
                                                       Root MSE      =  .32321

----------------------------------------------------------------------------------
                 |               Robust
   X_GEN_2012_11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
     o_anyprison |   .0080573    .018706     0.43   0.667    -.0286072    .0447218
X_registered2008 |   .0710959   .0037212    19.11   0.000     .0638022    .0783896
   X_GEN_2008_11 |   .3618851   .0067466    53.64   0.000     .3486617    .3751086
         age2012 |   .0008077   .0009864     0.82   0.413    -.0011255     .002741
       age2012_2 |  -.0009001   .0011753    -0.77   0.444    -.0032037    .0014035
          ismale |  -.0032063   .0041204    -0.78   0.436    -.0112825    .0048699
            rd_2 |    -.00401   .0052475    -0.76   0.445    -.0142952    .0062752
            rd_3 |    .012488   .0134798     0.93   0.354    -.0139328    .0389089
            rd_1 |  -.0016873   .0071168    -0.24   0.813    -.0156364    .0122618
            cd_1 |   .0205281   .0190362     1.08   0.281    -.0167834    .0578397
            cd_3 |   .0042991   .0255865     0.17   0.867    -.0458513    .0544496
            cd_4 |   .0134089    .015976     0.84   0.401    -.0179046    .0447223
            cd_5 |   .0177967   .0267796     0.66   0.506    -.0346923    .0702857
            cd_6 |  -.0014063   .0129292    -0.11   0.913     -.026748    .0239354
            cd_7 |   -.017182   .0168589    -1.02   0.308     -.050226    .0158619
            cd_8 |   .0351867   .0261751     1.34   0.179    -.0161175    .0864909
            cd_9 |   .0029169   .0085835     0.34   0.734    -.0139071    .0197408
           cd_10 |   .0251131   .0158965     1.58   0.114    -.0060445    .0562707
           cd_11 |   .0362231   .0213655     1.70   0.090     -.005654    .0781002
           cd_12 |   .0477375   .0742038     0.64   0.520    -.0977045    .1931794
           cd_13 |  -.0100077   .0187083    -0.53   0.593    -.0466766    .0266612
           cd_14 |  -.0075285   .0169339    -0.44   0.657    -.0407195    .0256625
           cd_15 |   .0324137   .0109078     2.97   0.003     .0110341    .0537934
           cd_16 |  -.0124664   .0318135    -0.39   0.695     -.074822    .0498891
           cd_17 |   .0202502   .0447448     0.45   0.651    -.0674512    .1079516
           cd_18 |   .0023975   .0229432     0.10   0.917    -.0425719     .047367
           cd_19 |   .0531322   .0387266     1.37   0.170    -.0227734    .1290378
           cd_20 |  -.0051422   .0202644    -0.25   0.800    -.0448612    .0345768
           cd_21 |   .0195199   .0138455     1.41   0.159    -.0076178    .0466577
           cd_22 |   .0350712   .0136931     2.56   0.010     .0082321    .0619102
           cd_23 |   .0097159   .0090658     1.07   0.284    -.0080533    .0274851
           cd_24 |   .0406335    .035885     1.13   0.258    -.0297024    .1109694
           cd_25 |   .0083892   .0131871     0.64   0.525     -.017458    .0342364
           cd_26 |  -.0083513   .0181844    -0.46   0.646    -.0439934    .0272908
           cd_27 |   .0143337     .08225     0.17   0.862    -.1468792    .1755467
           cd_28 |   .0051921    .015042     0.35   0.730    -.0242906    .0346749
           cd_29 |  -.0384093    .034602    -1.11   0.267    -.1062304    .0294118
           cd_30 |  -.0266306   .0296838    -0.90   0.370     -.084812    .0315507
           cd_31 |   .0319775   .0256662     1.25   0.213    -.0183292    .0822842
           cd_32 |   .0163424   .0236246     0.69   0.489    -.0299627    .0626474
           cd_33 |   .0543492   .0313258     1.73   0.083    -.0070504    .1157488
           cd_34 |   -.006374   .0400799    -0.16   0.874     -.084932     .072184
           cd_35 |  -.0234844   .0142236    -1.65   0.099    -.0513632    .0043943
           cd_36 |   .0143048   .0122471     1.17   0.243       -.0097    .0383095
           cd_37 |   .0095876   .0220619     0.43   0.664    -.0336545    .0528298
           cd_38 |   .0244193   .0175001     1.40   0.163    -.0098816    .0587202
           cd_39 |   .0199666   .0121347     1.65   0.100    -.0038177     .043751
           cd_40 |   .0033501   .0122389     0.27   0.784    -.0206386    .0273387
           cd_41 |    .018592   .0148913     1.25   0.212    -.0105956    .0477795
           cd_42 |    .014627   .0240593     0.61   0.543      -.03253    .0617841
           cd_43 |  -.0091773   .0166619    -0.55   0.582    -.0418351    .0234805
           cd_44 |   .0242048    .019595     1.24   0.217    -.0142021    .0626118
           cd_45 |    .015344    .015477     0.99   0.321    -.0149915    .0456796
           cd_46 |  -.0026039   .0088803    -0.29   0.769    -.0200095    .0148017
           cd_47 |   -.037266   .0476765    -0.78   0.434    -.1307136    .0561817
           cd_48 |   .0129937   .0117231     1.11   0.268     -.009984    .0359714
           cd_49 |   .0408391   .0202764     2.01   0.044     .0010966    .0805817
           cd_50 |   .0488763   .0251044     1.95   0.052    -.0003293    .0980818
           cd_51 |   .0069726   .0127574     0.55   0.585    -.0180322    .0319775
           cd_52 |   .0184255   .0286204     0.64   0.520    -.0376714    .0745225
           cd_53 |    .004505   .0638502     0.07   0.944    -.1206438    .1296537
           cd_54 |   .0084379   .0200496     0.42   0.674      -.03086    .0477358
           cd_55 |   .0194644   .0331008     0.59   0.557    -.0454143    .0843432
           cd_56 |   .0097058   .0315797     0.31   0.759    -.0521916    .0716032
           cd_57 |  -.0965067   .0690617    -1.40   0.162    -.2318701    .0388566
           cd_58 |  -.0184186   .0242157    -0.76   0.447    -.0658822     .029045
           cd_59 |  -.0108318   .0334682    -0.32   0.746    -.0764308    .0547671
           cd_60 |  -.0289398   .0385159    -0.75   0.452    -.1044323    .0465526
           cd_61 |  -.0086968    .024764    -0.35   0.725     -.057235    .0398415
           cd_62 |   .0269089   .0298915     0.90   0.368    -.0316794    .0854972
           cd_63 |   .0159907   .0165659     0.97   0.334     -.016479    .0484604
           cd_64 |    .002055   .0261853     0.08   0.937     -.049269    .0533791
           cd_65 |   .0233808   .0133606     1.75   0.080    -.0028065    .0495681
           cd_66 |   -.013458    .032868    -0.41   0.682    -.0778803    .0509644
           cd_67 |   .0098462   .0104976     0.94   0.348    -.0107295    .0304219
     o_anyfelony |   .0004493   .0075862     0.06   0.953    -.0144199    .0153184
  o_guidelinemin |   -.012549   .0148062    -0.85   0.397    -.0415697    .0164716
           ogs_2 |  -.0037723   .0064202    -0.59   0.557    -.0163561    .0088116
           ogs_3 |   .0035425   .0049478     0.72   0.474    -.0061554    .0132404
           ogs_4 |   .0178537   .0126934     1.41   0.160    -.0070258    .0427332
           ogs_5 |   -.007926   .0061996    -1.28   0.201    -.0200774    .0042254
           ogs_6 |   .0017896   .0158129     0.11   0.910    -.0292042    .0327834
           ogs_7 |  -.0033729     .01825    -0.18   0.853    -.0391436    .0323977
           ogs_8 |   .0418928   .0249756     1.68   0.093    -.0070602    .0908459
           ogs_9 |   .0445526   .0323773     1.38   0.169    -.0189081    .1080132
          ogs_10 |   .0173105   .0447957     0.39   0.699    -.0704907    .1051117
          ogs_11 |  -.0120149   .0651539    -0.18   0.854    -.1397189    .1156891
           _cons |   .0232045   .0210287     1.10   0.270    -.0180125    .0644214
----------------------------------------------------------------------------------

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyprison if e(sample)

. local inprison=r(N)*r(mean)

. outreg2 using "Table05_PA_EffectofPrisononParticipation_RestrictedSample.out", append se bracket label /*
> */ dec(3) symbol(***, **, *) ctitle("Excluding People Potentially Imprisoned in '12") /*
> */ addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated to Prison",`inprison')  
warning: addnote ignored in appended columns
dir : seeout

. 
. 
. ***********************************************************************
. *
. * Table A5, Jail sentence and 12 turnout (restricted sample) 
. *
. *
. * Note that column (1) is again out of order here; In the paper it appears in column 6
. *
. ***********************************************************************
. 
. use "sentencingvfreplication.dta", clear

. 
. * Runs matched pair first (for labeling reasons)
. drop X_registered2012 match_corrections2008-match_corrections2012 match_correctionsany /*
> */ o_multiplecounts o_priorreord tot_sent_records Incarcerated2012 age2012_2 r_countynum

. 
. keep if restricted_sample == 1
(68137 observations deleted)

. drop restricted_sample 

. 
. * drops prison and state intermediate punishment
. tab o_MS_SANCTION 

              MOST SERIOUS SANCTION |      Freq.     Percent        Cum.
------------------------------------+-----------------------------------
                       State Prison |        603        1.76        1.76
      State Intermediate Punishment |         31        0.09        1.85
                        County Jail |     12,075       35.28       37.13
Restrictive Intermediate Punishment |      5,779       16.88       54.01
                          Probation |     15,014       43.86       97.88
         Other Restorative Sanction |        727        2.12      100.00
------------------------------------+-----------------------------------
                              Total |     34,229      100.00

. drop if o_MS_SANCTION == 1 | o_MS_SANCTION == 2
(634 observations deleted)

. drop o_anyprison

. 
. gen o_anyjail = (o_MS_SANCTION == 3)

. drop o_MS_SANCTION 

. 
. preserve

. keep if o_anyjail==0
(12075 observations deleted)

. save "temp_noprisonformerge.dta", replace
file temp_noprisonformerge.dta saved

. restore

. keep if o_anyjail==1
(21522 observations deleted)

. rename age2012 age2012_toprison

. rename o_guidelinemin  o_guidelinemin_toprison

. rename unique_person_id_sent upis

. rename X_GEN_2012_11 X_GEN_2012_11_toprison

. count
12075

. joinby X_registered2008 X_GEN_2008_11 ismale rd_1 rd_2 rd_3 o_ogs o_anyfelony  using "temp_noprisonformerge.dta", unmatched(master)

. !erase "temp_noprisonformerge.dta"

/bin/bash: erase: command not found

. tab _merge

                       _merge |      Freq.     Percent        Cum.
------------------------------+-----------------------------------
          only in master data |         64        0.00        0.00
both in master and using data | 10,342,212      100.00      100.00
------------------------------+-----------------------------------
                        Total | 10,342,276      100.00

. drop if _merge~=3
(64 observations deleted)

. 
. * Now score the age matches
. gen agediff=abs(age2012-age2012_toprison)

. * require age to be withing 2.5 years on either side (5 year window)
. drop if agediff >2.5
(8767275 observations deleted)

. 
. *summarize differences in guideline sentences
. gen sentdiff=abs(o_guidelinemin_toprison-o_guidelinemin)

. * require sentence to be within .25 (3 months)
. drop if sentdiff>.25
(22767 observations deleted)

. 
. * Keeps closest in age
. * If that is tied, keeps closest in sentence length
. * If that is tied, keeps lowest ID number as tiebreaker
. gsort upis agediff sentdiff unique_person_id_sent 

. count if upis == upis[_n-1] & agediff == agediff[_n-1] & sentdiff == sentdiff[_n-1]
101521

. count if upis == upis[_n-1] & agediff == agediff[_n-1] & sentdiff == sentdiff[_n-1] & /*
> */ unique_person_id_sent == unique_person_id_sent[_n-1]  
    0

. drop if upis==upis[_n-1]
(1540591 observations deleted)

. count
11579

. 
. keep upis unique_person_id_sent X_GEN_2012_11 X_GEN_2012_11_toprison age2012 age2012_toprison o_guidelinemin o_guidelinemin_toprison X_GEN_2008_11

. 
. rename X_GEN_2012_11 X_GEN_2012_11_1

. rename X_GEN_2012_11_toprison X_GEN_2012_11_2

. rename age2012 age2012_1

. rename age2012_toprison age2012_2

. rename o_guidelinemin o_guidelinemin_1

. rename o_guidelinemin_toprison o_guidelinemin_2

. gen unique_person_id_sent_1 = upis

. rename unique_person_id_sent unique_person_id_sent_2

. 
. reshape long X_GEN_2012_11_ age2012_ o_guidelinemin_ unique_person_id_sent_, i(upis X_GEN_2008_11) j(treat) 
(note: j = 1 2)

Data                               wide   ->   long
-----------------------------------------------------------------------------
Number of obs.                    11579   ->   23158
Number of variables                  10   ->       7
j variable (2 values)                     ->   treat
xij variables:
        X_GEN_2012_11_1 X_GEN_2012_11_2   ->   X_GEN_2012_11_
                    age2012_1 age2012_2   ->   age2012_
      o_guidelinemin_1 o_guidelinemin_2   ->   o_guidelinemin_
unique_person_id_sent_1 unique_person_id_sent_2->unique_person_id_sent_
-----------------------------------------------------------------------------

. replace treat=treat-1
(23158 real changes made)

. 
. rename X_GEN_2012_11_ X_GEN_2012_11

. rename treat o_anyjail

. rename age2012_ age2012

. rename o_guidelinemin_ o_guidelinemin

. rename unique_person_id_ unique_person_id

. 
. areg X_GEN_2012_11 o_anyjail age2012 o_guidelinemin, absorb(upis) cluster(unique_person_id)

Linear regression, absorbing indicators           Number of obs   =      23158
                                                  F(   3,  19020) =       0.21
                                                  Prob > F        =     0.8881
                                                  R-squared       =     0.6129
                                                  Adj R-squared   =     0.2256
                                                  Root MSE        =     0.3198

                     (Std. Err. adjusted for 19021 clusters in unique_person_id)
--------------------------------------------------------------------------------
               |               Robust
 X_GEN_2012_11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
     o_anyjail |   .0011812    .004734     0.25   0.803    -.0080978    .0104602
       age2012 |   .0055098   .0140067     0.39   0.694    -.0219447    .0329642
o_guidelinemin |   -.067391   .1024753    -0.66   0.511    -.2682516    .1334696
         _cons |  -.0392421    .511443    -0.08   0.939    -1.041716    .9632316
---------------+----------------------------------------------------------------
          upis |   absorbed                                   (11579 categories)

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyjail if e(sample)

. local injail=r(N)*r(mean)

. outreg2 using "SA_Table05_PA_EffectofJailonParticipation_RestrictedSample.out", replace se bracket/*
> */ label  dec(3) symbol(***, **, *) ctitle("Matched Pairs") addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated To Jail",`injail')  
dir : seeout

. 
. * Regression analysis 
. use "sentencingvfreplication.dta", clear

. drop X_registered2012 match_corrections2008-match_corrections2012 match_correctionsany /*
> */ o_multiplecounts o_priorreord tot_sent_records

. 
. keep if restricted_sample == 1
(68137 observations deleted)

. drop restricted_sample 

. 
. * drops prison and state intermediate punishment
. tab o_MS_SANCTION 

              MOST SERIOUS SANCTION |      Freq.     Percent        Cum.
------------------------------------+-----------------------------------
                       State Prison |        603        1.76        1.76
      State Intermediate Punishment |         31        0.09        1.85
                        County Jail |     12,075       35.28       37.13
Restrictive Intermediate Punishment |      5,779       16.88       54.01
                          Probation |     15,014       43.86       97.88
         Other Restorative Sanction |        727        2.12      100.00
------------------------------------+-----------------------------------
                              Total |     34,229      100.00

. drop if o_MS_SANCTION == 1 | o_MS_SANCTION == 2
(634 observations deleted)

. drop o_anyprison

. 
. gen o_anyjail = (o_MS_SANCTION == 3)

. drop o_MS_SANCTION 

. label var o_anyjail "Any jail for most serious offense? (1=yes)"

. 
. * Checks we have common support on OGS
. tab o_ogs o_anyjail 

   Offense |   Any jail for most
   gravity |   serious offense?
     score |        (1=yes)
     (OGS) |         0          1 |     Total
-----------+----------------------+----------
         1 |     7,957      6,526 |    14,483 
         2 |     2,875        361 |     3,236 
         3 |     5,695      1,503 |     7,198 
         4 |       566        204 |       770 
         5 |     3,571      2,523 |     6,094 
         6 |       396        370 |       766 
         7 |       249        317 |       566 
         8 |       110        153 |       263 
         9 |        77         69 |       146 
        10 |        20         39 |        59 
        11 |         6         10 |        16 
-----------+----------------------+----------
     Total |    21,522     12,075 |    33,597 


. 
. * County Fixed Effects
. quietly tab r_countynum, gen(cd_)

. * Drop Allegheny county
. drop cd_2 r_countynum

. 
. * OGS Fixed Effects
. quietly tab o_ogs, gen(ogs_)

. * Drop offense gravity score 1
. drop ogs_1 o_ogs

. 
. * Bivariate regression, assigned to jail
. regress X_GEN_2012_11 o_anyjail, robust

Linear regression                                      Number of obs =   33597
                                                       F(  1, 33595) =    0.00
                                                       Prob > F      =  0.9454
                                                       R-squared     =  0.0000
                                                       Root MSE      =  .36552

------------------------------------------------------------------------------
             |               Robust
X_GEN_201~11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   o_anyjail |   .0002849   .0041569     0.07   0.945    -.0078627    .0084325
       _cons |   .1587213   .0024909    63.72   0.000      .153839    .1636036
------------------------------------------------------------------------------

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyjail if e(sample)

. local injail=r(N)*r(mean)

. outreg2 using "SA_Table05_PA_EffectofJailonParticipation_RestrictedSample.out", append se bracket label /*
> */ dec(3) symbol(***, **, *) ctitle("Bivariate Regression") /*
> */ addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated To Jail",`injail')  
warning: addnote ignored in appended columns
dir : seeout

. 
. * past participation
. regress X_GEN_2012_11 o_anyjail X_registered2008 X_GEN_2008_11 , robust

Linear regression                                      Number of obs =   33597
                                                       F(  3, 33593) = 1761.53
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.2205
                                                       Root MSE      =  .32273

----------------------------------------------------------------------------------
                 |               Robust
   X_GEN_2012_11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
       o_anyjail |   .0015863   .0036681     0.43   0.665    -.0056033    .0087759
X_registered2008 |   .0707692   .0036861    19.20   0.000     .0635444     .077994
   X_GEN_2008_11 |   .3629376   .0067124    54.07   0.000     .3497812    .3760941
           _cons |   .0440188   .0020413    21.56   0.000     .0400179    .0480198
----------------------------------------------------------------------------------

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyjail if e(sample)

. local injail=r(N)*r(mean)

. outreg2 using "SA_Table05_PA_EffectofJailonParticipation_RestrictedSample.out", append se bracket label /*
> */ dec(3) symbol(***, **, *) ctitle("Past Participation") /*
> */ addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated To Jail",`injail')  
warning: addnote ignored in appended columns
dir : seeout

. 
. * demographics
. regress X_GEN_2012_11 o_anyjail age2012 age2012_2 ismale rd_2 rd_3 rd_1 cd_* , robust

Linear regression                                      Number of obs =   33597
                                                       F( 73, 33523) =    1.03
                                                       Prob > F      =  0.4124
                                                       R-squared     =  0.0021
                                                       Root MSE      =  .36553

------------------------------------------------------------------------------
             |               Robust
X_GEN_201~11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   o_anyjail |  -.0009824   .0044555    -0.22   0.825    -.0097154    .0077505
     age2012 |  -.0001817   .0011038    -0.16   0.869    -.0023453    .0019818
   age2012_2 |   .0003096   .0013204     0.23   0.815    -.0022784    .0028976
      ismale |  -.0030725   .0045674    -0.67   0.501    -.0120248    .0058798
        rd_2 |   -.003941   .0058466    -0.67   0.500    -.0154005    .0075186
        rd_3 |   .0015318   .0156783     0.10   0.922    -.0291981    .0322618
        rd_1 |   .0013901   .0080562     0.17   0.863    -.0144004    .0171806
        cd_1 |   .0285364   .0207363     1.38   0.169    -.0121075    .0691803
        cd_3 |   .0040064   .0296648     0.14   0.893    -.0541376    .0621505
        cd_4 |   .0163744   .0185262     0.88   0.377    -.0199376    .0526865
        cd_5 |   .0199406   .0311141     0.64   0.522    -.0410441    .0809252
        cd_6 |   .0075182   .0144441     0.52   0.603    -.0207928    .0358292
        cd_7 |  -.0172516   .0183214    -0.94   0.346    -.0531622     .018659
        cd_8 |   .0488148    .028963     1.69   0.092    -.0079536    .1055832
        cd_9 |   .0070288   .0097772     0.72   0.472    -.0121348    .0261924
       cd_10 |   .0087482   .0181261     0.48   0.629    -.0267796     .044276
       cd_11 |   .0449107   .0239153     1.88   0.060    -.0019642    .0917855
       cd_12 |   .0801678   .1170454     0.68   0.493    -.1492451    .3095808
       cd_13 |  -.0165021   .0223583    -0.74   0.460    -.0603252     .027321
       cd_14 |  -.0103506   .0188366    -0.55   0.583    -.0472709    .0265698
       cd_15 |   .0303808    .012531     2.42   0.015     .0058196     .054942
       cd_16 |  -.0143131   .0312713    -0.46   0.647    -.0756059    .0469798
       cd_17 |   .0041829   .0453681     0.09   0.927    -.0847402     .093106
       cd_18 |   .0221083   .0259876     0.85   0.395    -.0288283     .073045
       cd_19 |   .0906885    .044232     2.05   0.040     .0039922    .1773848
       cd_20 |   .0015795   .0221393     0.07   0.943    -.0418143    .0449732
       cd_21 |   .0241043    .015919     1.51   0.130    -.0070975    .0553061
       cd_22 |   .0354246   .0155614     2.28   0.023     .0049237    .0659255
       cd_23 |   .0034476   .0102236     0.34   0.736     -.016591    .0234863
       cd_24 |   .0386008   .0395074     0.98   0.329     -.038835    .1160366
       cd_25 |   .0078761   .0151997     0.52   0.604    -.0219158     .037668
       cd_26 |  -.0179036   .0212801    -0.84   0.400    -.0596133    .0238061
       cd_27 |   .0328548   .1167906     0.28   0.778    -.1960589    .2617684
       cd_28 |   .0003178   .0169701     0.02   0.985    -.0329441    .0335798
       cd_29 |  -.0356975   .0440931    -0.81   0.418    -.1221216    .0507265
       cd_30 |  -.0181547   .0334723    -0.54   0.588    -.0837616    .0474522
       cd_31 |   .0269908   .0327309     0.82   0.410    -.0371629    .0911445
       cd_32 |   .0186796    .025783     0.72   0.469    -.0318559    .0692151
       cd_33 |   .0173593   .0348017     0.50   0.618    -.0508532    .0855718
       cd_34 |   .0260707   .0448279     0.58   0.561    -.0617935    .1139349
       cd_35 |  -.0413037   .0151461    -2.73   0.006    -.0709905   -.0116169
       cd_36 |   .0241391   .0141384     1.71   0.088    -.0035727     .051851
       cd_37 |    .007405   .0256239     0.29   0.773    -.0428188    .0576288
       cd_38 |   .0304672   .0204812     1.49   0.137    -.0096767     .070611
       cd_39 |   .0117565   .0137073     0.86   0.391    -.0151103    .0386233
       cd_40 |   .0142297   .0135987     1.05   0.295    -.0124242    .0408836
       cd_41 |   .0158381   .0163091     0.97   0.331    -.0161283    .0478044
       cd_42 |   .0141341   .0259093     0.55   0.585    -.0366491    .0649173
       cd_43 |  -.0021832   .0190925    -0.11   0.909    -.0396052    .0352387
       cd_44 |   .0293607   .0221034     1.33   0.184    -.0139626    .0726841
       cd_45 |   .0154385   .0180403     0.86   0.392     -.019921     .050798
       cd_46 |  -.0051794   .0100785    -0.51   0.607    -.0249336    .0145747
       cd_47 |  -.0063435   .0473653    -0.13   0.893    -.0991811    .0864941
       cd_48 |   .0123204   .0134082     0.92   0.358    -.0139602     .038601
       cd_49 |   .0368237    .022145     1.66   0.096    -.0065814    .0802287
       cd_50 |   .0488856   .0276366     1.77   0.077     -.005283    .1030543
       cd_51 |   .0124157   .0134328     0.92   0.355    -.0139131    .0387445
       cd_52 |   .0131469   .0318645     0.41   0.680    -.0493087    .0756025
       cd_53 |  -.0158797   .0625603    -0.25   0.800       -.1385    .1067406
       cd_54 |   .0164652   .0238562     0.69   0.490    -.0302938    .0632242
       cd_55 |   .0071188   .0346348     0.21   0.837    -.0607666    .0750042
       cd_56 |  -.0048912   .0351794    -0.14   0.889     -.073844    .0640616
       cd_57 |  -.0957619   .0518006    -1.85   0.065     -.197293    .0057692
       cd_58 |  -.0312876   .0264311    -1.18   0.237    -.0830935    .0205182
       cd_59 |   -.032383   .0339526    -0.95   0.340    -.0989313    .0341654
       cd_60 |   -.029812     .03608    -0.83   0.409    -.1005301    .0409062
       cd_61 |  -.0129858   .0268192    -0.48   0.628    -.0655523    .0395807
       cd_62 |   .0145425   .0343132     0.42   0.672    -.0527126    .0817976
       cd_63 |   .0278714   .0195634     1.42   0.154    -.0104736    .0662164
       cd_64 |     .00368    .030857     0.12   0.905    -.0568007    .0641608
       cd_65 |   .0247161   .0151568     1.63   0.103    -.0049918     .054424
       cd_66 |   -.023063   .0381206    -0.61   0.545    -.0977807    .0516546
       cd_67 |    .015292   .0117926     1.30   0.195     -.007822    .0384059
       _cons |     .15399   .0231342     6.66   0.000     .1086461    .1993339
------------------------------------------------------------------------------

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyjail if e(sample)

. local injail=r(N)*r(mean)

. outreg2 using "SA_Table05_PA_EffectofJailonParticipation_RestrictedSample.out", append se bracket label /*
> */ dec(3) symbol(***, **, *) ctitle("Demographics") /*
> */ addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated To Jail",`injail')  
warning: addnote ignored in appended columns
dir : seeout

. 
. * other stuff about crime
. regress X_GEN_2012_11 o_anyjail o_anyfelony o_guidelinemin ogs_*, robust

Linear regression                                      Number of obs =   33597
                                                       F( 13, 33583) =    1.05
                                                       Prob > F      =  0.3982
                                                       R-squared     =  0.0004
                                                       Root MSE      =  .36552

--------------------------------------------------------------------------------
               |               Robust
 X_GEN_2012_11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
     o_anyjail |   .0013773   .0043306     0.32   0.750    -.0071109    .0098655
   o_anyfelony |  -.0059005   .0084806    -0.70   0.487    -.0225228    .0107218
o_guidelinemin |  -.0109795   .0200971    -0.55   0.585    -.0503706    .0284116
         ogs_2 |  -.0035003   .0071657    -0.49   0.625    -.0175453    .0105448
         ogs_3 |   .0092681   .0055717     1.66   0.096    -.0016527    .0201888
         ogs_4 |   .0154873   .0141879     1.09   0.275    -.0123215    .0432961
         ogs_5 |   -.002294   .0073435    -0.31   0.755    -.0166875    .0120996
         ogs_6 |   .0077185   .0174079     0.44   0.657    -.0264016    .0418386
         ogs_7 |   .0126297   .0215272     0.59   0.557    -.0295643    .0548237
         ogs_8 |   .0502376   .0309997     1.62   0.105    -.0105229     .110998
         ogs_9 |   .0646919   .0409681     1.58   0.114    -.0156071    .1449908
        ogs_10 |   .0393069   .0639144     0.61   0.539    -.0859675    .1645813
        ogs_11 |  -.0567641   .0872385    -0.65   0.515    -.2277546    .1142263
         _cons |   .1572423   .0035978    43.71   0.000     .1501905     .164294
--------------------------------------------------------------------------------

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyjail if e(sample)

. local injail=r(N)*r(mean)

. outreg2 using "SA_Table05_PA_EffectofJailonParticipation_RestrictedSample.out", append se bracket label /*
> */ dec(3) symbol(***, **, *) ctitle("Crime Characterestics") /*
> */ addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated To Jail",`injail')  
warning: addnote ignored in appended columns
dir : seeout

. 
. * combined
. regress X_GEN_2012_11 o_anyjail X_registered2008 X_GEN_2008_11 age2012 age2012_2 ismale rd_2 rd_3 rd_1 cd_* o_anyfelony o_guidelinemin ogs_*, robust

Linear regression                                      Number of obs =   33597
                                                       F( 87, 33509) =   62.10
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.2224
                                                       Root MSE      =  .32273

----------------------------------------------------------------------------------
                 |               Robust
   X_GEN_2012_11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
       o_anyjail |   .0023379    .004104     0.57   0.569    -.0057062     .010382
X_registered2008 |   .0713326   .0036955    19.30   0.000     .0640892    .0785759
   X_GEN_2008_11 |   .3624288   .0067145    53.98   0.000     .3492681    .3755895
         age2012 |   .0007147   .0009838     0.73   0.468    -.0012136     .002643
       age2012_2 |  -.0007785   .0011737    -0.66   0.507     -.003079    .0015221
          ismale |  -.0037839   .0041172    -0.92   0.358    -.0118537     .004286
            rd_2 |  -.0053483   .0052076    -1.03   0.304    -.0155554    .0048587
            rd_3 |   .0096865   .0134146     0.72   0.470    -.0166066    .0359796
            rd_1 |  -.0008283   .0070868    -0.12   0.907    -.0147186    .0130621
            cd_1 |   .0160962    .018547     0.87   0.385    -.0202565    .0524489
            cd_3 |   .0021131   .0252132     0.08   0.933    -.0473057    .0515318
            cd_4 |   .0091194   .0159046     0.57   0.566    -.0220542     .040293
            cd_5 |   .0230789   .0277261     0.83   0.405    -.0312653    .0774231
            cd_6 |  -.0028374   .0129782    -0.22   0.827    -.0282751    .0226002
            cd_7 |  -.0177904   .0167919    -1.06   0.289    -.0507031    .0151222
            cd_8 |   .0272641   .0257839     1.06   0.290    -.0232733    .0778015
            cd_9 |   .0005621   .0087643     0.06   0.949    -.0166163    .0177404
           cd_10 |   .0221412   .0157202     1.41   0.159     -.008671    .0529533
           cd_11 |   .0364056   .0213127     1.71   0.088     -.005368    .0781793
           cd_12 |   .0546999   .0792271     0.69   0.490    -.1005879    .2099877
           cd_13 |  -.0089607   .0187987    -0.48   0.634    -.0458068    .0278855
           cd_14 |  -.0072872    .016932    -0.43   0.667    -.0404745       .0259
           cd_15 |    .029796   .0110611     2.69   0.007     .0081159     .051476
           cd_16 |  -.0107303   .0313829    -0.34   0.732    -.0722418    .0507812
           cd_17 |   .0200619   .0460705     0.44   0.663    -.0702379    .1103616
           cd_18 |   .0040206   .0229279     0.18   0.861    -.0409189    .0489601
           cd_19 |   .0520328   .0387439     1.34   0.179    -.0239066    .1279722
           cd_20 |  -.0098393   .0200426    -0.49   0.623    -.0491236     .029445
           cd_21 |   .0164474   .0138467     1.19   0.235    -.0106925    .0435874
           cd_22 |    .033303   .0136475     2.44   0.015     .0065535    .0600525
           cd_23 |   .0105095   .0091698     1.15   0.252    -.0074637    .0284827
           cd_24 |   .0330205   .0355552     0.93   0.353    -.0366688    .1027099
           cd_25 |    .011715   .0131594     0.89   0.373    -.0140779    .0375079
           cd_26 |  -.0053566   .0183158    -0.29   0.770    -.0412562     .030543
           cd_27 |    .012033   .0821526     0.15   0.884    -.1489889    .1730549
           cd_28 |   .0046009   .0150981     0.30   0.761    -.0249919    .0341936
           cd_29 |  -.0410012   .0340165    -1.21   0.228    -.1076746    .0256723
           cd_30 |  -.0307188   .0287896    -1.07   0.286    -.0871473    .0257098
           cd_31 |   .0398355   .0262041     1.52   0.128    -.0115255    .0911965
           cd_32 |   .0143905   .0231689     0.62   0.535    -.0310214    .0598024
           cd_33 |   .0334909    .029233     1.15   0.252    -.0238068    .0907886
           cd_34 |  -.0010262   .0396842    -0.03   0.979    -.0788086    .0767562
           cd_35 |  -.0259293   .0140946    -1.84   0.066    -.0535552    .0016967
           cd_36 |   .0182223   .0124173     1.47   0.142     -.006116    .0425606
           cd_37 |   .0037257   .0213634     0.17   0.862    -.0381472    .0455987
           cd_38 |   .0205289   .0172426     1.19   0.234    -.0132672    .0543251
           cd_39 |   .0200326   .0121953     1.64   0.100    -.0038707    .0439358
           cd_40 |   .0064096   .0122127     0.52   0.600    -.0175277    .0303469
           cd_41 |   .0166132   .0145704     1.14   0.254    -.0119452    .0451716
           cd_42 |   .0153254   .0238655     0.64   0.521    -.0314518    .0621026
           cd_43 |  -.0069064   .0169056    -0.41   0.683    -.0400421    .0262292
           cd_44 |   .0214261   .0193902     1.10   0.269    -.0165794    .0594317
           cd_45 |   .0126453   .0153973     0.82   0.412     -.017534    .0428245
           cd_46 |  -.0052141   .0089853    -0.58   0.562    -.0228256    .0123973
           cd_47 |   -.027347   .0491696    -0.56   0.578    -.1237212    .0690272
           cd_48 |   .0099169   .0116263     0.85   0.394     -.012871    .0327049
           cd_49 |   .0400383    .019742     2.03   0.043     .0013432    .0787334
           cd_50 |   .0425813   .0246047     1.73   0.084    -.0056448    .0908073
           cd_51 |   .0039976   .0125505     0.32   0.750    -.0206019    .0285971
           cd_52 |    .013828   .0283203     0.49   0.625    -.0416809    .0693368
           cd_53 |   .0032189   .0639097     0.05   0.960    -.1220463    .1284841
           cd_54 |   .0021757   .0198185     0.11   0.913    -.0366692    .0410206
           cd_55 |   .0165434   .0323513     0.51   0.609    -.0468663    .0799531
           cd_56 |   .0075887   .0312974     0.24   0.808    -.0537552    .0689326
           cd_57 |  -.0977072    .069268    -1.41   0.158    -.2334748    .0380604
           cd_58 |  -.0223286   .0239576    -0.93   0.351    -.0692862    .0246291
           cd_59 |  -.0142412   .0314762    -0.45   0.651    -.0759357    .0474533
           cd_60 |  -.0350417   .0379954    -0.92   0.356     -.109514    .0394306
           cd_61 |  -.0100182   .0239951    -0.42   0.676    -.0570493     .037013
           cd_62 |   .0282554    .030854     0.92   0.360    -.0322196    .0887304
           cd_63 |   .0118792   .0165398     0.72   0.473    -.0205393    .0442978
           cd_64 |   -.011057   .0260772    -0.42   0.672    -.0621692    .0400553
           cd_65 |   .0234742   .0132828     1.77   0.077    -.0025606    .0495091
           cd_66 |  -.0148494   .0321232    -0.46   0.644     -.077812    .0481133
           cd_67 |   .0094554   .0105576     0.90   0.370     -.011238    .0301487
     o_anyfelony |   .0009345   .0075494     0.12   0.901    -.0138626    .0157316
  o_guidelinemin |  -.0097856   .0170813    -0.57   0.567    -.0432655    .0236944
           ogs_2 |  -.0022849   .0064584    -0.35   0.723    -.0149436    .0103737
           ogs_3 |   .0053311   .0049835     1.07   0.285    -.0044367    .0150989
           ogs_4 |   .0178234   .0124464     1.43   0.152     -.006572    .0422188
           ogs_5 |   -.009109   .0064619    -1.41   0.159    -.0217746    .0035566
           ogs_6 |   .0010467   .0159274     0.07   0.948    -.0301716     .032265
           ogs_7 |   .0002498   .0190165     0.01   0.990    -.0370233    .0375229
           ogs_8 |   .0319403   .0264333     1.21   0.227      -.01987    .0837505
           ogs_9 |   .0552614   .0345854     1.60   0.110    -.0125272    .1230501
          ogs_10 |   .0249692    .052347     0.48   0.633    -.0776327    .1275712
          ogs_11 |  -.0400953   .0757728    -0.53   0.597    -.1886126    .1084219
           _cons |   .0247506   .0209165     1.18   0.237    -.0162465    .0657477
----------------------------------------------------------------------------------

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyjail if e(sample)

. local injail=r(N)*r(mean)

. outreg2 using "SA_Table05_PA_EffectofJailonParticipation_RestrictedSample.out", append se bracket label /*
> */ dec(3) symbol(***, **, *) ctitle("Complete Model") /*
> */ addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated To Jail",`injail')  
warning: addnote ignored in appended columns
dir : seeout

. 
. * Removing people who may still be incarcerated in 2012
. regress X_GEN_2012_11 o_anyjail X_registered2008 X_GEN_2008_11 age2012 age2012_2 ismale rd_2 rd_3 rd_1 cd_* o_anyfelony o_guidelinemin ogs_* if Incarcerated2012 == 0, robust

Linear regression                                      Number of obs =   32850
                                                       F( 87, 32762) =   60.59
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.2222
                                                       Root MSE      =  .32299

----------------------------------------------------------------------------------
                 |               Robust
   X_GEN_2012_11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
       o_anyjail |   .0016236   .0041587     0.39   0.696    -.0065276    .0097749
X_registered2008 |   .0709059   .0037406    18.96   0.000     .0635742    .0782377
   X_GEN_2008_11 |    .362748   .0067902    53.42   0.000     .3494388    .3760571
         age2012 |   .0006184   .0009927     0.62   0.533    -.0013274    .0025642
       age2012_2 |    -.00068   .0011823    -0.58   0.565    -.0029974    .0016373
          ismale |  -.0032926    .004149    -0.79   0.427    -.0114248    .0048395
            rd_2 |  -.0043679   .0052992    -0.82   0.410    -.0147544    .0060187
            rd_3 |   .0148379   .0138487     1.07   0.284     -.012306    .0419819
            rd_1 |  -.0018045    .007143    -0.25   0.801     -.015805     .012196
            cd_1 |   .0195471   .0190795     1.02   0.306    -.0178495    .0569436
            cd_3 |   .0034589   .0256671     0.13   0.893    -.0468495    .0537673
            cd_4 |    .011229   .0160176     0.70   0.483    -.0201661    .0426241
            cd_5 |   .0225235   .0276176     0.82   0.415     -.031608    .0766549
            cd_6 |   .0004086   .0131568     0.03   0.975    -.0253791    .0261964
            cd_7 |  -.0172357   .0169363    -1.02   0.309    -.0504315    .0159601
            cd_8 |   .0319047    .026279     1.21   0.225    -.0196032    .0834125
            cd_9 |    .002016   .0088235     0.23   0.819    -.0152784    .0193105
           cd_10 |   .0233524   .0158489     1.47   0.141     -.007712    .0544169
           cd_11 |   .0379446   .0215164     1.76   0.078    -.0042284    .0801176
           cd_12 |   .0551199    .079244     0.70   0.487    -.1002012    .2104409
           cd_13 |  -.0104224   .0187576    -0.56   0.578    -.0471879    .0263432
           cd_14 |  -.0100461   .0169567    -0.59   0.554    -.0432817    .0231896
           cd_15 |   .0305447   .0111481     2.74   0.006     .0086941    .0523953
           cd_16 |  -.0091134   .0321002    -0.28   0.776     -.072031    .0538041
           cd_17 |   .0212526   .0460748     0.46   0.645    -.0690557    .1115608
           cd_18 |   .0020652    .023148     0.09   0.929    -.0433057     .047436
           cd_19 |   .0544282   .0391098     1.39   0.164    -.0222284    .1310848
           cd_20 |  -.0067997   .0202759    -0.34   0.737    -.0465412    .0329418
           cd_21 |   .0193833   .0139849     1.39   0.166    -.0080277    .0467943
           cd_22 |   .0339073   .0137748     2.46   0.014     .0069083    .0609064
           cd_23 |   .0103935    .009242     1.12   0.261    -.0077212    .0285082
           cd_24 |   .0351849   .0358703     0.98   0.327    -.0351223     .105492
           cd_25 |   .0104441   .0132949     0.79   0.432    -.0156145    .0365026
           cd_26 |  -.0081382    .018358    -0.44   0.658    -.0441207    .0278442
           cd_27 |   .0132309   .0821624     0.16   0.872    -.1478104    .1742721
           cd_28 |   .0036891   .0151686     0.24   0.808     -.026042    .0334202
           cd_29 |  -.0388904   .0346139    -1.12   0.261     -.106735    .0289542
           cd_30 |  -.0275925   .0298245    -0.93   0.355    -.0860497    .0308646
           cd_31 |    .027807   .0256098     1.09   0.278    -.0223892    .0780031
           cd_32 |   .0162322   .0237533     0.68   0.494    -.0303252    .0627896
           cd_33 |   .0538373   .0313931     1.71   0.086    -.0076944     .115369
           cd_34 |  -.0071149   .0400916    -0.18   0.859    -.0856959    .0714661
           cd_35 |  -.0233401   .0146496    -1.59   0.111    -.0520539    .0053737
           cd_36 |   .0158255   .0124966     1.27   0.205    -.0086683    .0403193
           cd_37 |   .0062051   .0220131     0.28   0.778    -.0369413    .0493515
           cd_38 |   .0203955   .0174388     1.17   0.242    -.0137852    .0545763
           cd_39 |   .0201706   .0122572     1.65   0.100    -.0038538    .0441951
           cd_40 |    .005119   .0124129     0.41   0.680    -.0192106    .0294487
           cd_41 |   .0163951   .0148718     1.10   0.270    -.0127542    .0455443
           cd_42 |   .0146428   .0241704     0.61   0.545     -.032732    .0620176
           cd_43 |  -.0106087   .0169234    -0.63   0.531    -.0437792    .0225617
           cd_44 |   .0243441   .0198635     1.23   0.220    -.0145892    .0632774
           cd_45 |    .014353    .015712     0.91   0.361    -.0164432    .0451492
           cd_46 |  -.0027899   .0090564    -0.31   0.758    -.0205407    .0149609
           cd_47 |  -.0368551   .0485993    -0.76   0.448    -.1321114    .0584012
           cd_48 |   .0122946   .0117869     1.04   0.297    -.0108081    .0353973
           cd_49 |   .0382004    .020456     1.87   0.062    -.0018941    .0782949
           cd_50 |   .0484332    .025111     1.93   0.054    -.0007852    .0976516
           cd_51 |   .0051081   .0129392     0.39   0.693    -.0202532    .0304693
           cd_52 |   .0148548   .0285208     0.52   0.602     -.041047    .0707567
           cd_53 |   .0040051   .0639267     0.06   0.950    -.1212935    .1293037
           cd_54 |   .0033061    .020028     0.17   0.869    -.0359495    .0425617
           cd_55 |   .0188969   .0331587     0.57   0.569    -.0460954    .0838892
           cd_56 |   .0097395   .0318766     0.31   0.760    -.0527397    .0722188
           cd_57 |  -.0972118   .0692492    -1.40   0.160    -.2329427    .0385192
           cd_58 |  -.0185913   .0242202    -0.77   0.443    -.0660637     .028881
           cd_59 |  -.0109941   .0335076    -0.33   0.743    -.0766703     .054682
           cd_60 |  -.0295518    .038546    -0.77   0.443    -.1051034    .0459999
           cd_61 |  -.0109334   .0251467    -0.43   0.664    -.0602218     .038355
           cd_62 |   .0258838   .0312503     0.83   0.408     -.035368    .0871356
           cd_63 |   .0119789   .0167063     0.72   0.473     -.020766    .0447239
           cd_64 |   -.004212   .0259182    -0.16   0.871    -.0550126    .0465886
           cd_65 |   .0236686   .0133516     1.77   0.076    -.0025011    .0498383
           cd_66 |   -.013871    .032906    -0.42   0.673     -.078368     .050626
           cd_67 |   .0094553   .0106121     0.89   0.373    -.0113449    .0302554
     o_anyfelony |   .0014737   .0076992     0.19   0.848     -.013617    .0165644
  o_guidelinemin |  -.0099359   .0174953    -0.57   0.570    -.0442273    .0243554
           ogs_2 |  -.0034817   .0065532    -0.53   0.595    -.0163262    .0093627
           ogs_3 |   .0035972   .0050428     0.71   0.476    -.0062869    .0134813
           ogs_4 |   .0156323   .0127153     1.23   0.219    -.0092901    .0405548
           ogs_5 |  -.0092133   .0065571    -1.41   0.160    -.0220655    .0036389
           ogs_6 |  -.0006181    .016489    -0.04   0.970    -.0329371    .0317009
           ogs_7 |  -.0023532   .0195939    -0.12   0.904     -.040758    .0360515
           ogs_8 |    .032257   .0271304     1.19   0.234    -.0209196    .0854336
           ogs_9 |   .0459847   .0353074     1.30   0.193    -.0232191    .1151886
          ogs_10 |   .0272302   .0545368     0.50   0.618    -.0796639    .1341243
          ogs_11 |  -.0410482   .0767131    -0.54   0.593    -.1914087    .1093123
           _cons |   .0267589   .0211382     1.27   0.206    -.0146729    .0681906
----------------------------------------------------------------------------------

. qui summ X_GEN_2012_11 if e(sample)

. local vote12=r(mean)

. qui summ X_GEN_2008_11 if e(sample)

. local vote08=r(mean)

. qui summ o_anyjail if e(sample)

. local injail=r(N)*r(mean)

. outreg2 using "SA_Table05_PA_EffectofJailonParticipation_RestrictedSample.out", append se bracket label /*
> */ dec(3) symbol(***, **, *) ctitle("Excluding People Potentially Imprisoned in '12") /*
> */ addnote("Note: Cell entries are OLS estimates with robust standard errors in brackets. *p<.1; **p<.05; ***p<.01.") /*
> */ addstat("Prop. Voting 2012",`vote12',"Prop. Voting 2008",`vote08',"Number Treated To Jail",`injail')  
warning: addnote ignored in appended columns
dir : seeout

. 
. log close
      name:  <unnamed>
       log:  /Users/marcmere/Box Sync/Shared_EffectofIncarceration_Pennslyvania/Replication Data/PA sentencing/PASentencingData.log
  log type:  text
 closed on:  17 Dec 2016, 10:21:13
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
